c# stringbuilder to file

54

c# stringbuilder to file -

using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"\hereIam.txt"))
{
    file.WriteLine(sb.ToString()); // "sb" is the StringBuilder
}

c# stringbuilder to file -

System.IO.File.WriteAllText(@"C:\TextFile.txt", stringBuilder.ToString());

Comments

Submit
0 Comments